package com.example.common.util.model;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
//import lombok.Data;

import java.util.List;

//@Data
public class FileNode {
    /**
     * 目录名称
     */
    private String directoryName;
    /**
     * 文件路径集合
     */
    private List<String> fileList;

    /**
     * 文件子节点
     */
    private List<FileNode> fileNode;

    /**
     * 判断是否存在
     *
     * @return
     */
    public boolean isNodeExists() {
        if (CollUtil.isEmpty(this.fileNode)) {
            return false;
        }
        return true;
    }

    public boolean isFileExists() {
        if (CollUtil.isEmpty(this.fileList)) {
            return false;
        }
        return true;
    }

    public boolean isDirNameExists() {
        if (StrUtil.isEmpty(this.directoryName)) {
            return false;
        }
        return true;
    }

    public List<FileNode> getFileNode() {
        return fileNode;
    }

    public String getDirectoryName() {
        return directoryName;
    }

    public List<String> getFileList() {
        return fileList;
    }

    public void setDirectoryName(String directoryName) {
        this.directoryName = directoryName;
    }

    public void setFileList(List<String> fileList) {
        this.fileList = fileList;
    }

    public void setFileNode(List<FileNode> fileNode) {
        this.fileNode = fileNode;
    }
}